package com.ctu.gzero.utils
{
	import mx.logging.*;
	import mx.logging.targets.*;
	public class GzLogger
	{
		protected static var logger:ILogger;
		
		public static const ALL:int = LogEventLevel.ALL;
		public static const DEBUG:int = LogEventLevel.DEBUG;
		public static const ERROR:int = LogEventLevel.ERROR;
		public static const FATAL:int = LogEventLevel.FATAL;
		public static const INFO:int = LogEventLevel.INFO;
		public static const WARN:int = LogEventLevel.WARN;
		
		public function GzLogger()
		{
			logger = null;
		}
		
		public static function getLogger(category:String):ILogger
		{
			if(logger == null){
				var logTarget:TraceTarget = new TraceTarget();

				// Log all log levels.
	            logTarget.level = LogEventLevel.ALL;
	
	            // Add date, time, category, and log level to the output.
	            logTarget.includeDate = false;
	            logTarget.includeTime = true;
	            logTarget.includeCategory = true;
	            logTarget.includeLevel = true;
	
	            // Begin logging.
	            Log.addTarget(logTarget);
	
				logger = Log.getLogger(category);
			}
			
			logger = Log.getLogger(category);
			return logger;
		}

	}
}